package FIleInpuSteam;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyFile {
    public static void main(String[] args)  {
        try (   FileInputStream in = new FileInputStream("D:\\wc.txt");
                FileOutputStream   ou = new FileOutputStream("D:\\wc2.txt");
                ){
            byte[] bytes = new byte[1024];
            int len;
            while ((len=in.read(bytes))!=-1){
                ou.write(bytes,0,len);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        System.out.println("复制完成");
    }
}
